package com.example.smartclassroom.controller;

import com.example.smartclassroom.service.RoomServie;
import com.example.smartclassroom.util.JsonDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/room")
public class RoomController {
    @Autowired
    private RoomServie roomServie;
    /**
     * 根据id查询房间信息
     */
    @RequestMapping("/queryRoomById")
    public JsonDate queryRoomById(Integer id) {
        return roomServie.queryRoomById(id);
    }

    /**
     * 查询所有教室名
     */
    @GetMapping("/queryAllRoomName")
    public JsonDate queryAllRoomName() {
        return roomServie.queryAllRoomName();
    }
}
